import org.junit.jupiter.api.Test;

/*
 * @description 饿汉式
 * @author 罗添煦
 * @create 2024-08-20 下午3:35
 */
public class Singleton_03 {
    private static Singleton_03 instance = new Singleton_03();

    private Singleton_03() {
    }

    public static Singleton_03 getInstance() {
        return instance;
    }

    @Test
    public void test1() {
        Singleton_03 instance1 = Singleton_03.getInstance();
        Singleton_03 instance2 = Singleton_03.getInstance();
        System.out.println(instance1 == instance2);
    }
}
